package Practica

class TripController {

    
    //def index() { }
    def save = {
        def trip = new Trip(params)
        if(!trip.hasErrors() && trip.save()){
            flash.message ="Trip ${trip.id} created"
            redirect(action:show,id:trip.id)
        }
        else{
            
            flash.message ="DATOS INCONSITENTES: DUPLICADO NAME O USE MAS DE 3 CARATERES"
            render(view:'create',model:[trip:trip])  }
     
}
  def scaffold = Trip
}
